<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title>会员中心-{$web_config['web_title']}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<link href="/assets/css/frontend.min.css?v=1.0.1" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
        <link href="/assets/css/user.css?v=1.0.1" rel="stylesheet">
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    </head>
    <body>
        {include file="header"}
        <main class="content">
            <style>
    .panel-recharge h3 {
        margin-bottom: 15px;
        margin-top: 10px;
        color: #444;
        font-size: 16px;
    }

    .row-recharge > div {
        margin-bottom: 10px;
    }

    .row-recharge > div > label {
        width: 100%;
        height: 40px;
        display: block;
        font-size: 14px;
        line-height: 40px;
        color: #999;
        background: #fff;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
        cursor: pointer;
        text-align: center;
        border: 1px solid #ddd;
        margin-bottom: 20px;
        font-weight: 400;
    }

    .row-recharge > div > label.active {
        border-color: #0d95e8;
        color: #0d95e8;
    }

    .row-recharge > div > label:hover {
        z-index: 4;
        border-color: #27b0d6;
        color: #27b0d6;
    }

    .panel-recharge .custommoney {
        border: none;
        height: 100%;
        width: 100%;
        display:inherit;
        line-height: 100%;
    }

    .row-recharge > div {
        height: 40px;
        line-height: 40px;
    }

    .row-recharge > div input.form-control {
        borer: none;
    }

    .row-paytype div input {
        display: none;
    }

    .row-paytype img {
        height: 22px;
        margin: 8px;
        vertical-align: inherit;
    }

    .btn-recharge {
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        padding: 0;
    }

</style>
<div id="content-container" class="container">
    <div class="row">
        {include file="user_left"}
        <div class="col-md-9">
            <div class="panel panel-default panel-recharge">
                <div class="panel-body">
                    <h2 class="page-header">充值余额</h2>
						<button type="button" class="btn btn-default" onClick="url('{:url('user/recharge')}')"> 客服充值</button>
                        {if !empty($paylist)}
                        	{volist name="$paylist" id="vo"}
                        	<button type="button" class="btn {if $pay==$vo.pay_tag}btn-primary{else}btn-default{/if}" onClick="url('{:url('user/recharge_pay',array('pay'=>$vo.pay_tag))}')"> {$vo.pay_title}</button>
                            {/volist}
                        {/if}
                        {if $config['s_bank_open']==1}
						<button type="button" class="btn btn-default" onClick="url('{:url('user/recharge_bank')}')"> 银行卡充值</button>
                        {/if}
					<div style="height:20px;"></div>
                    <div class="alert alert-info-light">{$config['s_qrcode_title']}</div>
                    <div class="clearfix" ></div>

                    <form id="sendinfo-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" >
                        <div class="form-group">
                            <label for="fren" class="control-label col-xs-12 col-sm-2">充值金额:</label>
                            <div class="col-xs-12 col-sm-4"><input type="text" class="form-control" id="money" name="money"  placeholder="充值金额" value=""/></div>
                        </div>
                        </form>
                        <div class="row row-recharge" style="margin:20px -15px 0 -15px;">
                            <div class="col-xs-6 col-sm-4 col-md-4 col-lg-2">
                                <input type="submit" class="btn btn-success btn-recharge btn-block sub" value="立即充值" />
                            </div>
                        </div>
                         
   
                   
                </div>
            </div>
        </div>
    </div>
</div>
        </main>
		{include file="footer_content"}
		
<script>
function url(url)
{
	window.location.href = url;
}


$(".sub").click(function(){
	var money = $("#money").val();

	if(money == ""){
		alert("ERROR：充值金额不能为空！");
		return false
	}
		
	if(money < 0){
		alert("ERROR：充值金额不能小于0！");
		return false
	}
	

	$.ajax({
		type:"POST",
		url:"{:url('user/recharge_pay_ok')}",
		dataType:"json",
		data:{
			money:money,
			paytag:"{$pay}",
		},
		success:function(res){
			if(res.status == "success"){
				window.location.href = res.data;
			}else{
				alert(res.data);
			}
		},
		error:function(jqXHR){
			console.log("Error: "+jqXHR.status);
		},
	});
	
});

</script>
    </body>
</html>